if

Runs a command but only if a given condition is satisfied.
   if [not] errorlevel number command [options]
   if [not] string1==string2 command [options]
   if [not] exist [d:][path]filename command [options]

Options

   not
   With this, the command will be run if the condition is false.
   (Without this, the command will be run if the condition is true.)
   
   command
   This command that will be run if the condition is satisfied.

   options
   These will be passed to the command if it is run.

Conditions

   errorlevel number
   DOS Programs return a number when they exit, which sometimes contains
   information on whether the program was successful.
   If the last program to exit returned the given number, then the condition
   is true.

   string1==string2
   If the two strings of characters are equal, then the condition is true.

   exist [d:][path]filename
   If the given file is there, then the condition is true.

See Also

batch files
Copyright © 2003 Rob Platt
This file forms part of The FreeDOS HTML Help Documentation, and is covered under its terms: see index.htm